const { buildSync } = require('esbuild')
const { join } = require('path')
let arg = process.argv.slice(2)
let isDev = true

if (arg.length > 0) {
  if (arg[0] == 'release') {
    isDev = false
  }
}
function buildRender() {
  let result = buildSync({
    bundle: true,
    platform:"node",
    external: ['electron','easywin'],
    minify: isDev ? false : true,
    outfile: join(__dirname, '../dist/render.js'),
    entryPoints: [join(__dirname, '../src/render/render.ts')]
  })
  console.log(result)
}

buildRender()